<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>const 命令只限制声明的常量值</title>

    <script>
        const obj = {};
        // 为obj对象添加一个属性，是可以的
        obj.age = 23;
        console.log(obj.age);// 23
        // 尝试修改obj的引用地址，就会报错
        // Uncaught TypeError: Assignment to constant variable.
        obj = {};
    </script>
</head>
<body></body>
</html>